using System;
using System.ComponentModel;
using System.Collections.Generic;

using Castle.ActiveRecord;

/// <summary>
/// Business entity class generated from AccountRepository
/// </summary>
/// <remarks>
/// Created by: huanhvhd
/// Created date: [2011-04-23]
/// </remarks>
namespace TVN.ShopMan.ActiveModels
{
	[ActiveRecord("AccountRepository")]
	public partial class AccountRepository : ActiveRecordBase<AccountRepository>
	{
		#region Properties
		
        /// <summary>
        /// All properties
        /// </summary>
		public class Properties
		{
			public const string Id = "Id";
			public const string FromDate = "FromDate";
			public const string ToDate = "ToDate";
			public const string IsActive = "IsActive";
			public const string CreatedDate = "CreatedDate";
			public const string LastModifiedDate = "LastModifiedDate";
			public const string Creator = "Creator";
			public const string LastModifier = "LastModifier";
			public const string Account = "Account";
			public const string Repository = "Repository";
		}

		#endregion

		#region Private fields

		private long _id;
		private DateTime _fromDate;
		private DateTime? _toDate;
		private bool _isActive;
		private DateTime _createdDate;
		private DateTime? _lastModifiedDate;
		private Account _creatorId;
		private Account _lastModifierId;
		private Account _accountId;
		private Repository _repositoryId;


		#endregion

		#region Constructors

		public AccountRepository()
		{
		}

		#endregion

		#region Properties

		[PrimaryKey("Id", Access = PropertyAccess.NosetterLowercaseUnderscore)]
		public long Id
		{
			get { return _id; }
		}

		[Property("FromDate", NotNull = true)]
		public DateTime FromDate
		{
			get { return _fromDate; }
			set { _fromDate = value; }
		}

		[Property("ToDate")]
		public DateTime? ToDate
		{
			get { return _toDate; }
			set { _toDate = value; }
		}

		[Property("IsActive", NotNull = true)]
		public bool IsActive
		{
			get { return _isActive; }
			set { _isActive = value; }
		}

		[Property("CreatedDate", NotNull = true)]
		public DateTime CreatedDate
		{
			get { return _createdDate; }
			set { _createdDate = value; }
		}

		[Property("LastModifiedDate")]
		public DateTime? LastModifiedDate
		{
			get { return _lastModifiedDate; }
			set { _lastModifiedDate = value; }
		}

		[BelongsTo("CreatorId", Type = typeof(Account))]
		public Account Creator
		{
			get { return _creatorId; }
			set { _creatorId = value; }
		}

		[BelongsTo("LastModifierId", Type = typeof(Account))]
		public Account LastModifier
		{
			get { return _lastModifierId; }
			set { _lastModifierId = value; }
		}

		[BelongsTo("AccountId", Type = typeof(Account))]
		public Account Account
		{
			get { return _accountId; }
			set { _accountId = value; }
		}

		[BelongsTo("RepositoryId", Type = typeof(Repository))]
		public Repository Repository
		{
			get { return _repositoryId; }
			set { _repositoryId = value; }
		}

		#endregion

	} }
